<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>首页</title>
		<link rel="stylesheet" href="../css/bootstrap.min.css" />
		<link rel="stylesheet" href="../css/page.css" />
			<script type="text/javascript" src="../js/jquery.min.js" ></script>
	<script type="text/javascript" src="../js/bootstrap.min.js" ></script>
	</head>

	<body>
		<div class="left">
			<div class="bigTitle">新闻后台管理系统</div>
			<div class="lines">
				<div class="pageClick"><img src="../img/icon-7.png" />首页</div>
				<div  class="pageClick"><img src="../img/icon-1.png" />用户管理</div>
				<div class="pageClick"><img src="../img/icon-6.png" />新闻管理</div>
				<div class="pageClick"><img src="../img/icon-4.png" />登录日志</div>
				<div class="pageClick"><img src="../img/icon-5.png" />操作日志</div>
				<div class="pageClick"><img src="../img/icon-3.png" />系统接口</div>
				<div class="pageClick active"><img src="../img/icon-11.png" />新建管理员</div>
			</div>
		</div>
		<div class="top">
			<div class="leftTiyle" id="flTitle">新建管理员</div>
			<div class="thisUser"><button class="btn btn-danger tuichu">退出后台</button></div>
		</div>

		<div class="content">
			<div class="panel panel-default content_p">
			  
			  <div class="panel-body">
									    <div class="form-horizontal">
						  <div class="form-group">
						    <label for="inputEmail3" class="col-sm-2 control-label">登录名</label>
						    <div class="col-sm-10">
						      <input type="text" class="form-control adminName" id="inputEmail3" placeholder="登录账号">
						    </div>
						  </div>
						  <div class="form-group">
						    <label for="inputPassword3" class="col-sm-2 control-label">登录密码</label>
						    <div class="col-sm-10">
						      <input type="password" class="form-control adminPass" id="inputPassword3" placeholder="登录密码">
						    </div>
						  </div>	
						   <div class="form-group">
						    <label for="inputPassword3" class="col-sm-2 control-label">联系方式</label>
						    <div class="col-sm-10">
						      <input type="text" class="form-control phone"  placeholder="联系方式">
						    </div>
						  </div>						 
						  <div class="form-group">
						    <div class="col-sm-offset-2 col-sm-10">
						      <button  class="btn btn-success">确定</button>
						      <button  class="btn btn-info">重置</button>
						    </div>
						  </div>
						</div>
			  </div>
			</div>
		</div>
		<script type="text/javascript">
			
			
			$(".btn-success").click(function(){
				    var adminName = $(".adminName").val();
					var adminPass = $(".adminPass").val();
					var phone = $(".phone").val();
                 if(adminName==='' || adminPass==="" || phone===""){
                 	alert("输入完整信息！");
                 }
                 else{
                 var URL = "http://127.0.0.1:8080/admin/addAdmin?adminName="+adminName+"&adminPass="+adminPass+"&phone="+phone;
	              $.ajax({
	                type: "get",
	                url: URL,
	                success:function(data){alert(data);clear();},
	                error:function(){alert("服务器异常！");}
                 });
             }

			});
            $(".btn-info").click(function(){
            	clear();
            });
	        function clear(){
	        	$("input").val("");
	        }
		</script>
			<script type="text/javascript" src="../js/url.js"></script>
	</body>

</html>